package com.wawayaya.api.remote;


/**
 * Created by creative on 15/7/3.
 */
public class ApiConstans {

    /**内网测试服*/
    public final static int SERVER_TEST = 0;
    /**外网测试服*/
    public final static int SERVER_PUBLIC_TEST = 1;
    /**正式服*/
    public final static int SERVER_PUBLIC = 2;
    /**当前连接的服务器*/
    public final static int CURRENT_SERVER = SERVER_TEST;

    /** Request host*/
    public final static String  URL_PUBLIC = "http://api2-joyreader.wawayaya.com"; //公网
    public final static String  URL_PUBLIC_TEST = "http://testapi2-joyreader.wawayaya.com"; //公网测试
    public final static String  URL_TEST = "http://10.135.195.150:9797"; //内网测试

    /** 网络请求修改 */
    public static String getUrlprefix() {
        switch(CURRENT_SERVER)
        {
            case SERVER_TEST:
                return URL_TEST;
            case SERVER_PUBLIC_TEST:
                return URL_PUBLIC_TEST;
            case SERVER_PUBLIC:
                return URL_PUBLIC;
        }
        return null;
    }

    /** return  common key */
    public  final static String    FLAG = "flag";
    public  final static String    MESSAGE = "msg";
    public  final static String    RETINFO = "retinfo";
    public  final static String    RETINFO_SERVERTIME = "server_timestamp";
    public  final static String    REQUEST_UID = "userId";

    public  final static Integer   FLAG_SUCCESS = 1;
    public  final static Integer   FLAG_ERROR   = 0;
    public  final static Integer   FLAG_TOKEN_ERROR   = 1001;
    public  final static  String   TIMEOUT = "TimeoutError";

    /** config Name  key */
    public  final static  String   CONFIG_BOOK_COVER = "book_cover_img";
    public  final static  String   CONFIG_DUYIN = "duyin";
    public  final static  String   CONFIG_PEITU = "peitu";
    public  final static  String   CONFIG_BOOKSHELF = "bookshelf_icon_img";
    public  final static  String   CONFIG_BANNER = "banner_img";
    public  final static  String   CONFIG_QUIZ = "quiz";
    public  final static  String   CONFIG_ZIP = "zip_file";
    public  final static  String   CONFIG_SUPPORT = "support_file";
    public  final static  String   CONFIG_DUBA_URL = "duba_url";
    public  final static  String   DICT_EXPIRE = "dict_expire";
    public  final static  String   DICT_LIMITED = "dict_limited";


    /** language */
    public  final static  String   LANG_EN = "en";
    public  final static  String   LANG_CN = "cn";

    /**    plat,支付平台，1支付宝，2 appstore  4 paypal */
    public  final static  int   ZFB =1;
    public  final static  int   APPSTORE = 2;
    public  final static  int   PAYPAL = 4;
    public  final static  String  ALIPAY_STR = "alipay";
    public  final static  String  PAYPAL_STR = "paypal";
    /**
     * 支付来源
     */
    public final static int JOYREADER_PAY = 1;
    public final static int DUBA_PAY = 2;

    /** net request type*/

    public final static int USER_REGISTER = 1;
    public final static int USER_LOGIN = 2;

    public final static int USER_UPDATE = 3;
    public final static int USER_UPDATE_PWD = 4;
    public final static int BOOKSHELF = 5;
    public final static int CONFIG = 6;
    public final static int BANNER = 7;
    public final static int AREA = 8;
    public final static int BOOK = 9;
    public final static int SUPPORT = 10;
    public final static int MYBOOKSHELF = 11;
    public final static int MYBOOKSHELF_MERGEMINE = 12;
    public final static int NOTICE = 13;
    public final static int QUIZ = 14;
    public final static int UNLOGIN = 15;
    public final static int READRECORD = 16;
    public final static int DETAIL = 17;
    public final static int UPDATEUSER = 18;
    public final static int PAY_PAGE = 19;
    public final static int ORDER = 20;
    public final static int DEVICE = 21;
    public final static int SHELFLIST = 22;
    public final static int WORD = 23;
    public final static int LOGINJOYREADER = 24;
    public final static int DUba_USER_LOGIN = 25;
    public final static int DUba_VERSION_CHECK = 26;
    public final static int PAYPAYVAL = 27;
    public final static int HOMEPAGE = 28;
    public final static int ADVERT = 29;


    /** teacher parent tag*/
    public final static int INDEX_HOME = 30;
    public final static int TP_LIB = 31;
    public final static int TP_THEME_LIB_BOOKS  = 32;
    public final static int TP_SERIES_LIB_BOOKS  = 33;
    public final static int TP_RECOMMEND_LIB_BOOKS  = 34;
    public final static int TP_AGE_LIB_BOOKS  = 35;
    public final static int TP_GRADE_LIB_BOOKS  = 36;
    public final static int TP_ENG_LIB_BOOKS  = 37;


    /** 同步上传阅读数据的条数 */
    public final static int  ReadRecordCount= 10;

    public final static String  PLATFORM = "android";

    /** 未登录账号获取基础信息 */
    public final static String getLoginDevice() {
        return getUrlprefix()+ "/api/user/loginDevice";
    }

    /** 登录接口 */
    public final static String getLoginUrl() {
        return getUrlprefix()+ "/api/user/login";
    }
    /** 修改用户信息 */
    public  final  static String  updateUserUrl(){
        return  getUrlprefix()+"/api/user/updateUserInfo";
    }
    /** joyreader自己应用的登陆接口 , 同步用户信息，服务端判断是否超时 等 */
    public final static String getLoginJoyreader() {
        return getUrlprefix() + "/api/user/loginJoyReader";
    }
    /** 国家信息 */
    public final static String getCountryUrl() {
        return getUrlprefix() + "/api/area/list";
    }
    /** 获取配置信息  */
    public final static String getConfigUrl() {
        return getUrlprefix() + "/api/config/getConfig";
    }
    /** 获取支持文件信息  */
    public final static String getSupportUrl() {
        return getUrlprefix() + "/api/supportfile/list";
    }
    /** 获取banner */
    public final static String getBannerUrl() {
        return getUrlprefix() + "/api/banner/list";
    }



    /** 获取书架列表 */
    public final static String getBookSelfListUrl() {
        return getUrlprefix() + "/api/bookshelf/list";
    }

    /** 我的书架 */
    public final static String getMyBookShelf() {
        return getUrlprefix() + "/api/book/listFromMine";
    }
    /** 我的书架:合并接口数据，即 我的书架中的 删除、排序更新 */
    public final static String getMergeMine() {
        return getUrlprefix() + "/api/book/mergeMine";
    }

    /** notice  */
    public final static String getNotice() {
        return getUrlprefix() + "/api/notice/list";
    }

    /** quiz */
    public final static String getQuiz() {
        return getUrlprefix() + "/api/quiz/list";
    }

    /** 同步用户阅读的数据接口	 */
    public final static String getReaerRecordUrl() {
        return getUrlprefix() + "/api/user/synchronous";
    }
    /** 通过图书id获取图书信息	 */
    public final static String getBookDetailUrl() {
        return getUrlprefix() + "/api/book/detail";
    }
    /** 获取支付价格页面  */
    public final  static  String   getPayPage(){
        return getUrlprefix() + "/api/pay/page";
    }

    /** 支付方式选择页面*/
    public final  static  String   getPayPageChoose(){
        return getUrlprefix() + "/api/pay/page/choose";
    }

    /**auth验证*/
    public  final  static String  getAuthorVal(){
        return getUrlprefix() + "/api/paypal/payment";
    }

    /**获取订单信息*/
    public  final  static String  getOrderInfor(){
        return getUrlprefix() + "/api/pay/order";
    }
    /**支付宝回调地址*/
    public  final  static String  getAlipay(){
        return getUrlprefix() + "/pay/alipay/callback";
    }

    /**paypal回调地址*/
    public  final  static String  getPayPalCallback(){
        return getUrlprefix() + "/pay/alipay/callback";
    }
    /** 返回的所有书架list */
    public  final  static String  getShelfs(){
        return getUrlprefix() + "/api/book/list";
    }


    /**获取取词解释内容*/
    public  final  static String  getDictInfo() {
        return getUrlprefix() + "/api/dictionary/common/word";
    }
    /** 返回的所有书架list */
    public  final  static String  getHomepage(){
        return getUrlprefix() + "/api/homePage/list";
    }

    /** 获取广告列表  */
    public  final  static String  getAdvert(){
        return getUrlprefix() + "/api/advert/list";
    }


    /**
     * 教师家长中心
     */
    public final static String gettpHomeData() {
        return getUrlprefix()+ "/api/cmu/chome";
    }


    /**
     * 教师家长中心选书页获取可选书列表
     */
    public final static String getTpBookListToChoose() {
        return getUrlprefix()+ "/api/cmu/lib";
    }

    /**
     * 教师家长中心选书获取主题类书架书籍列表
     */
    public final static String getTpBookListFromThemeLib() {
        return getUrlprefix()+ "/api/cmu/theme/books";
    }
    /**
     * 教师家长中心选书获取系列类书架书籍列表
     */
    public final static String getTpBookListFromSeriesLib() {
        return getUrlprefix()+ "/api/cmu/series/books";
    }
    /**
     * 教师家长中心选书获取推荐类书架书籍列表
     */
    public final static String getTpBookListFromRecommendLib() {
        return getUrlprefix()+ "/api/cmu/bkshelf/books";
    }

    /**
     * 教师家长中心选书获取分龄类书架书籍列表
     */
    public final static String getTpBookListFromAgeLib() {
        return getUrlprefix()+ "/api/cmu/age/books";
    }

    /**
     * 教师家长中心选书获取年级类书架书籍列表
     */
    public final static String getTpBookListFromGradeLib() {
        return getUrlprefix()+ "/api/cmu/grade/books";
    }

    /**
     * 教师家长中心选书获取英文书类书架书籍列表
     */
    public final static String getTpBookListFromEnglishLib() {
        return getUrlprefix()+ "/api/cmu/bkshelf/lang/books";
    }

}
